<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Promise改变状态和指定回调的顺序问题</title>
</head>
<body>

  <script>
    let p = new Promise((resolve,reject)=>{
      setTimeout(()=>{
        console.log('ppd');
        resolve('ok');
      },1000)
    })

    p.then(value=>{
      console.log(value);
    },resson=>{

    })

    //1.先执行resolve后执行then:resolev的函数是同步代码的化，就会按着正确去执行的
    //2.先指定回调，后改变状态
  </script>
  
</body>
</html>